from django.db import models


# class CarInfoModel(models.Model):
#     length = models.FloatField(verbose_name='车长')
#     wheel_num = models.IntegerField(verbose_name='车轮数量')
#     wheel_base = models.FloatField(verbose_name='轴距', null=True)
#     create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
#     update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')
#
#     class Meta:
#         ordering = ['-create_time']
#
#
# class PlateModel(models.Model):
#     plate_name = models.CharField(max_length=50, verbose_name='车牌')
#     car_image = models.ImageField(null=True)
#     create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
#     update_time = models.DateTimeField(auto_now_add=True, verbose_name='更新时间')
#
#     class Meta:
#         ordering = ['-create_time']


class CarPlate(models.Model):
    car_id = models.CharField(max_length=100, verbose_name='汽车编号')
    car_plate = models.CharField(max_length=100, verbose_name='车牌')
    picture_path = models.ImageField(max_length=100, verbose_name='车牌图片')
    picture_path1 = models.ImageField(max_length=100, null=True, blank=True, verbose_name='汽车图片1')
    picture_path2 = models.ImageField(max_length=100, null=True, blank=True, verbose_name='汽车图片2')
    picture_path3 = models.ImageField(max_length=100, null=True, blank=True, verbose_name='汽车图片3')

    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        db_table = 'car_plate'
        ordering = ['-create_time']


class CarParameter(models.Model):
    car_id = models.CharField(max_length=100, verbose_name='汽车编号')
    wheel_num = models.IntegerField(verbose_name='车轮数')
    wheel_base = models.FloatField(verbose_name='轴距')
    car_length = models.FloatField(verbose_name='车长')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        db_table = 'car_parameter'
        ordering = ['-create_time']


class CarData(models.Model):
    car_id = models.CharField(max_length=100, verbose_name='汽车编号')
    car_data = models.TextField(verbose_name='汽车数据')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        db_table = 'car_data'
        ordering = ['-create_time']
